package com.springboot.learn_sofa_rpc_client;

import com.alipay.sofa.rpc.config.ConsumerConfig;
import com.springboot.IRpcService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class LearnSofaRpcClientApplication {

    public static void main(String[] args) {
        ApplicationContext context=SpringApplication.run(LearnSofaRpcClientApplication.class, args);

        RpcHander rpcHander=context.getBean(RpcHander.class);
        ConsumerConfig<IRpcService> consumerConfig=rpcHander.getConsumer();
        //生成代理类
        IRpcService helloService=consumerConfig.refer();
        System.out.println(helloService.saySync("你好啊"));
    }
}
